﻿using System;
using System.Net;
using Grundy.Common;
using Grundy.Entity;
using Grundy.Message;

namespace Grundy.Licensing.Server
{
    public class ClientSessionNotFoundException : Exception
    {
        private readonly Guid _clientSessionId;
        private readonly EndPoint _endPoint;
        private readonly FeatureIdentificationKey _featureIdentificationKey;

        public ClientSessionNotFoundException(Guid clientSessionId, EndPoint endPoint, FeatureIdentificationKey featureIdentificationKey)
        {
            _clientSessionId = clientSessionId;
            _endPoint = endPoint;
            _featureIdentificationKey = featureIdentificationKey;
        }

        public override string Message
        {
            get { return "The checkin failed because the client session could not be found. Client Session Id: {0}, Client Endpoint: {1}, Feature Identification Key: ".FormatWith(_clientSessionId, _endPoint, _featureIdentificationKey); }
        }
    }
}